Public Class ScanQueue
    Inherits Base

    Private mlSessionID As Long
    Private mlServerID As Long
    Private mlDatabaseID As Long
    Private mlScanTypeID As SQLAutoDocLib.ScanSchedule.Type
    Private msScanStart As String
    Private msScanComplete As String

    Public Sub New()
        MyBase.New()

        Dim oNextID As New DBNextIDValue("ScanQueue")
        Dim lNextID As Long = oNextID.NextValue

        Me.ID = lNextID
    End Sub

    Public Sub New( _
                ByVal lID As Long)

        MyBase.New(lID)
    End Sub

#Region "Properties"
    Public Property SessionID() As Long
        Get
            Return mlSessionID
        End Get
        Set(ByVal value As Long)
            mlSessionID = value
        End Set
    End Property

    Public Property ServerID() As Long
        Get
            Return mlServerID
        End Get
        Set(ByVal value As Long)
            mlServerID = value
        End Set
    End Property

    Public Property DatabaseID() As Long
        Get
            Return mlDatabaseID
        End Get
        Set(ByVal value As Long)
            mlDatabaseID = value
        End Set
    End Property

    Public Property ScanTypeID() As SQLAutoDocLib.ScanSchedule.Type
        Get
            Return mlScanTypeID
        End Get
        Set(ByVal value As SQLAutoDocLib.ScanSchedule.Type)
            mlScanTypeID = value
        End Set
    End Property

    Public Property ScanStart() As String
        Get
            Return msScanStart
        End Get
        Set(ByVal value As String)
            msScanStart = value
        End Set
    End Property

    Public Property ScanComplete() As String
        Get
            Return msScanComplete
        End Get
        Set(ByVal value As String)
            msScanComplete = value
        End Set
    End Property
#End Region

#Region "database"
    Public Sub Load()
        Dim oObject As New DBScanQueue

        oObject.Load(Me)
    End Sub

    Public Sub Save()
        Dim oObject As New DBScanQueue

        If mbObjectExists = True Then
            oObject.Update(Me)
        Else
            Me.CreateDate = Now
            oObject.Add(Me)
            mbObjectExists = True
        End If
    End Sub

    Public Sub Delete()
        Dim oObject As New DBScanQueue

        oObject.Delete(Me)
        mbObjectExists = False
    End Sub
#End Region

End Class
